#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <unordered_set>
#define int long long 
using namespace std;
const int N = 10000;
int q[N];
int n;
bool judge(int x)
{
	if (q[x] - q[x - 1] < n)
		return true;
	else return false;
}
void solve()
{
int ans = 0;
	cout << ans << '-' << endl;
	for (int i = 1; i <= 10000; i++)
		q[i] = i * i;
	cin >> n;
	int l = 1, r = N;
	while (l < r)
	{
		int m = l + r >> 1;
		//cout << m << '&' << endl;
		if (judge(m)) l = m + 1;
		else r = m;
	}
	l--;
	cout << l << '*' << endl;
	unordered_set<int> s;
	//int ans = 0;
	bool flag = false;
	for (int i = l; i > 0; i--)
	{
		for (int j = i - 1; j >= 0; j--)
			if (q[i] - q[j] < n && s.find(q[i] - q[j]) == s.end())
			{
				cout << q[i] - q[j] << ' ';
				s.insert(q[i] - q[j]);
				ans++;
				cout << ans << '^' << endl;
				if (j == 0)
				{
					flag = true;
					ans += (i - 1) * i / 2;
				}
			}
		if (flag)
			break;
	}
	cout << endl;
	cout << ans << endl;
}

signed main()
{
	int t = 1;
	//cin >> t;
	while (t--)
		solve();
	return 0;
}
